package com.example.config;

import com.example.nio.tranport.mina.factory.MinaServerFactory;
import com.example.nio.tranport.mina.handler.RequestHandler;
import com.example.nio.tranport.mina.server.MinaServerFactoryImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @author: chentao
 * @data 2025年02月02日 下午8:53
 */
@Configuration
public class MinaServerConfig {

    @Resource
    private RequestHandler requestHandler;

    @Bean
    public MinaServerFactory minaServerFactory() {
        MinaServerFactoryImpl minaServerFactory = new MinaServerFactoryImpl();
        minaServerFactory.setRequestHandler(requestHandler);
        return minaServerFactory;
    }
}
